package com.simple.system.util;

import com.simple.system.entity.AppPermissions;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import java.util.ArrayList;
import java.util.List;

public class PermissionUtils {
    public static List<GrantedAuthority> getAllPermissions() {
        List<GrantedAuthority> authorities = new ArrayList<>();
        for (AppPermissions permission : AppPermissions.values()) {
            authorities.add(new SimpleGrantedAuthority(permission.getAuthority()));
        }
        return authorities;
    }
}